Page({
  data: {
    list: [],
  },

  onShow() {
    // 获取报修列表
    this.getRepairList()
  },

  async getRepairList() {
    const { code, data } = await wx.http({
      url: '/repair',
      data: {
        current: 1,
        pageSize: 100,
      },
    })
    if (code !== 10000) return wx.toast()
    // console.log(data.rows)
    this.setData({
      list: data.rows,
    })
  },

  goDetail(ev) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + ev.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
